//Camera Class-
#include "Camera.h"

//CameraControl objects
Camera Camera::CameraControl;

//default constructor
Camera::Camera() {
	X = Y = 0;

	TargetX = TargetY = NULL;

	TargetMode = TARGET_MODE_NORMAL;
}

//OnMove
void Camera::OnMove(int MoveX, int MoveY) {
	X += MoveX;
	Y += MoveY;
}

//GetX
int Camera::GetX() {
	if(TargetX != NULL) {
		if(TargetMode == TARGET_MODE_CENTER) {
			return *TargetX - (WWIDTH / 2);
		}

		return *TargetX;
	}

	return X;
}

//GetY
int Camera::GetY() {
	if(TargetY != NULL) {
		if(TargetMode == TARGET_MODE_CENTER) {
			return *TargetY - (WHEIGHT / 2);
		}

		return *TargetY;
	}

	return Y;
}

//SetPos
void Camera::SetPos(int X, int Y) {
	this->X = X;
	this->Y = Y;
}

//SetTarget
void Camera::SetTarget(float* X, float* Y) {
	TargetX = X;
	TargetY = Y;
}
